package com.dci.dao.pms;

import com.dci.model.XtgOgzInfo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface XtgOgzInfoMapper {
    int deleteByPrimaryKey(@Param("id") String id);

    int insert(XtgOgzInfo record);

    int insertSelective(XtgOgzInfo record);

    XtgOgzInfo selectByPrimaryKey(@Param("id") String id);

    int updateByPrimaryKeySelective(XtgOgzInfo record);

    int updateByPrimaryKey(XtgOgzInfo record);

    List<XtgOgzInfo> getAllOgz();

    /**
     * 根据前缀查询部门
     *
     * @param level
     * @return
     */
    List<XtgOgzInfo> getChildOgzListByLevel(@Param("level") String level);

    /**
     * 批量更新
     *
     * @param xtgOgzInfoList
     */
    void batchUpdateLevel(@Param("xtgOgzInfoList") List<XtgOgzInfo> xtgOgzInfoList);

    /**
     * 查询是否有重复
     *
     * @param parentId
     * @param name
     * @param id
     * @return
     */
    int countByNameAndParentId(@Param("parentId") String parentId, @Param("name") String name, @Param("id") String id);
}